<script setup>
	import { onLoad } from '@dcloudio/uni-app'
	import { ref } from 'vue'
	import { getFeature } from '@/api/user'
	
	const loading = ref(false)
	const form = ref({
		featureId: '',
		description: ''
	})
	const parseStyle = ref({
		img: 'max-width: 750rpx'
	})
	
	function getData(id) {
		loading.value = true
		getFeature(id).then(res => {
			let result = res.result || {images: []}
			form.value = result
			loading.value = false
		}).catch(() => loading.value = false)
	}
	
	onLoad((option) => {
		let id = option.id
		let title = option.title || '详情'
		uni.setNavigationBarTitle({
			title
		})
		if(id) getData(id)
	})
</script>

<template>
	<view class="app-container">
		<uv-skeletons :loading="loading" :skeleton="[{ type: 'line', num: 1, gap: '24rpx', style: ['height: 400rpx']}]">
			<uv-parse :content="form.description" :tagStyle="parseStyle"></uv-parse>
		</uv-skeletons>
	</view>
</template>

<style lang="scss" scoped>
	
</style>